package com.jie.eduservice.client;

import com.jie.commonutils.ResultEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 远程调用service-vod服务的接口方法
 * @author XieZhiJie
 * @create 2020-10-13 20:59
 */
@FeignClient(
        name = "service-vod",
        fallback = VodFileDegradeFeignClient.class  // 熔断类
)
@Component
public interface VodClient {

    /**
     * 根据视频id删除阿里云视频
     * @param id  要删除的阿里云的视频id
     * @return    返回是否成功
     */
    @DeleteMapping("/eduvod/video/removeAliVideo/{id}")
    ResultEntity removeAliVideo(@PathVariable("id") String id);

    /**
     * 删除多个阿里云视频的方法
     * @param videoIdList  要删除的一系列视频id
     * @return             返回是否删除成功
     */
    @DeleteMapping("/eduvod/video/delete-batch")
    ResultEntity deleteBatch(@RequestParam("videoIdList") List<String> videoIdList);

}
